#include<bits/stdc++.h>
using namespace std;
int a[100005],c[100005];
int main(){
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
     for(int i=1;i<=m;i++)
        scanf("%d",&c[i]);
    int k=1;
    while(k<n){
        k=(k<<1);
    }
    cout<<k<<endl;
    return 0;
}
